package org.example;

import ch.qos.logback.classic.spi.EventArgUtil;

import java.awt.*;
import java.awt.event.InputEvent;
import java.util.concurrent.TimeUnit;

public class java程序控制鼠标和键盘 {
    public static void main(String[] args) throws AWTException, InterruptedException {

        Robot robot = new Robot();

        //鼠标移动到 x=594,y=246
        robot.mouseMove(594, 246);
        //鼠标左键按下 休眠100ms后释放
        robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
        robot.delay(100);
        robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);






    }
}
